let _that;

function getAppGlobalData(that) {
  _that = that;

  getApp().util.request({
    'url': 'entry/wxapp/config',
    'cachetime': '30',
    'showLoading': false,
    'method': 'POST',
    'data': {
    },
    success: function (res) {
      // console.log("entry/wxapp/config ==>", res)
      if (!res.data.errno) {
        getApp().globalData.config = res.data.data;
      }
    },
    fail: function (res) {
      console.log("config fail ==>>")
    }
  })

  getApp().util.request({
    'url': 'entry/wxapp/company',
    'cachetime': '30',
    'showLoading': false,
    'method': 'POST',
    'data': {
    },
    success: function (res) {
      // console.log("entry/wxapp/company ==>", res)
      if (!res.data.errno) {
        getApp().globalData.company = res.data.data;
      }
    },
    fail: function (res) {
      console.log("company fail ==>>")
    }
  })
 
  // _that.setData({
  //   globalData: getApp().globalData
  // })

  console.log(_that.data.globalData,"_that.data.globalData")

}

module.exports = {
  getAppGlobalData: getAppGlobalData
};


